home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 414_02 / portable / scrollok.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-17  |  1.4 KB  |  55 lines

  1. #define    CURSES_LIBRARY    1
  2. #include <curses.h>
  3. #undef    scrollok
  4.  
  5. #ifdef PDCDEBUG
  6. char *rcsid_scrollok = "$Header: C:\CURSES\portable\RCS\scrollok.c 2.1 1993/06/18 20:21:06 MH Rel MH $";
  7. #endif
  8.  
  9.  
  10.  
  11.  
  12.  
  13. /*man-start*********************************************************************
  14.  
  15.   scrollok()    - scrollok window
  16.  
  17.   X/Open Description:
  18.      This function controls what happens when the cursor of a window
  19.      is moved off the edge of the window or scrolling region, either
  20.      from a newline on the bottom line or by typing the last character
  21.      of the last line.  If the option is disabled, the cursor is left
  22.      on the bottom line.  If enabled, the window is scrolled up one
  23.      line and then refreshed.
  24.  
  25.   PDCurses Description:
  26.      This is also implemented as a macro.
  27.  
  28.   X/Open Return Value:
  29.      The scrollok() function returns OK on success otherwise ERR
  30.      is returned.
  31.  
  32.   PDCurses Errors:
  33.      It is an error to pass a NULL* window.
  34.  
  35.   Portability:
  36.      PDCurses    int scrollok( WINDOW* win, bool bf );
  37.      X/Open Dec '88    int scrollok( WINDOW* win, bool bf );
  38.      SysV Curses    int scrollok( WINDOW* win, bool bf );
  39.      BSD Curses    int scrollok( WINDOW* win, bool bf );
  40.  
  41. **man-end**********************************************************************/
  42.  
  43. int    scrollok(WINDOW *win, bool bf)
  44. {
  45. #ifdef PDCDEBUG
  46.     if (trace_on) PDC_debug("scrollok() - called\n");
  47. #endif
  48.  
  49.     if  (win == (WINDOW *)NULL)
  50.         return( ERR );
  51.  
  52.     win->_scroll    = bf;
  53.     return( OK );
  54. }
  55.